<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java 自动装箱与拆箱机制详解</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .code-container {
            background: #282c34;
            border-radius: 12px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
            position: relative;
            overflow: hidden;
        }
        .code-header {
            background: #21252b;
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .code-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }
        pre {
            margin: 0;
            padding: 24px;
            overflow-x: auto;
        }
        code {
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
            color: #abb2bf;
            font-size: 14px;
            line-height: 1.6;
        }
        .keyword { color: #c678dd; }
        .type { color: #e06c75; }
        .number { color: #d19a66; }
        .string { color: #98c379; }
        .comment { color: #5c6370; font-style: italic; }
        .method { color: #61afef; }
        .card {
            background: white;
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(0,0,0,0.15);
        }
        .concept-badge {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        .highlight-text {
            background: linear-gradient(120deg, #ffd89b 0%, #19547b 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: 700;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6 text-center">
            <h1 class="text-5xl font-bold mb-4" style="font-family: 'Noto Serif SC', serif;">
                Java 自动装箱与拆箱
            </h1>
            <p class="text-xl opacity-90 max-w-2xl mx-auto">
                深入理解基本类型与包装类之间的自动转换机制
            </p>
            <div class="mt-8 flex justify-center gap-4">
                <span class="concept-badge"><i class="fas fa-box"></i> 自动装箱</span>
                <span class="concept-badge"><i class="fas fa-box-open"></i> 自动拆箱</span>
                <span class="concept-badge"><i class="fas fa-equals"></i> 值比较</span>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto px-6 py-12">
        <!-- Code Example Section -->
        <div class="mb-12">
            <h2 class="text-3xl font-bold mb-6 text-gray-800" style="font-family: 'Noto Serif SC', serif;">
                <i class="fas fa-code text-purple-600 mr-3"></i>代码示例
            </h2>
            <div class="code-container">
                <div class="code-header">
                    <div class="code-dot bg-red-500"></div>
                    <div class="code-dot bg-yellow-500"></div>
                    <div class="code-dot bg-green-500"></div>
                    <span class="text-gray-400 ml-4 text-sm">Test.java</span>
                </div>
                <pre><code><span class="keyword">public</span> <span class="keyword">void</span> <span class="method">test1</span>(){
    <span class="type">int</span> a = <span class="number">10</span>;
    <span class="type">Integer</span> b = <span class="keyword">new</span> <span class="type">Integer</span>(<span class="number">10</span>);
    
    <span class="type">System</span>.out.<span class="method">println</span>(a==b); <span class="comment">// 自动拆箱 true</span>
    <span class="type">System</span>.out.<span class="method">println</span>(b.<span class="method">equals</span>(a)); <span class="comment">// true</span>
}</code></pre>
            </div>
        </div>

        <!-- Concept Visualization 